Skip to content

When using endpointDirectory includes endpoint name #910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

adamk33n3r
Copy link
Contributor

This adds the endpoint name after the endpointDirectory config option if supplied.

@ZaLiTHkA
Copy link

Just to check.. The other day I tried to generate an endpoint at company/detail and ended up with the following:

  • a path of [proj]/server/api/company/detail/company/detail.controller.js
  • variables in the module files were all company/detail instead of detail

Is this change intended to correct this behaviour, or is this for something else?

@adamk33n3r
Copy link
Contributor Author

This is for something different. I've never encountered your issue though. What command did you run exactly?

@ZaLiTHkA
Copy link

Ah, ok.. No worries then. I ran yo angular-fullstack:endpoint company/detail, hoping to simply get a detail endpoint inside a company dir.

Anyways, I don't really want to derail this PR, so I'll try reproduce it in a clean project and post a new report about it. This was the closest I found when searching this repo for more info, so I thought I'd ask just in case. :)

@adamk33n3r
Copy link
Contributor Author

Ah. So actually you need to run the generator with just the endpoint name as a parameter like 'detail'. Then when the command is run it asks you for dir and that's when you put 'api/company' or something like that.

No worries about derailing. Always happy to help people.

@ZaLiTHkA
Copy link

Thanks for the suggestion, that is actually what I ended up with anyway; but the endpoint generator only prompts for the endpoint URL, not the folder path... It works this way, but I'm (a software tester by trade and) too pedantic to settle for simply "it works".

Anyways, I posted a more detailed query at #934 to see if I get some more clarification on this.

@kingcody
Copy link
Member

@adamk33n3r do you think this change could be accomplished with:

var dest = (this.config.get('endpointDirectory') || 'server/api/') + this.name;

@kingcody
Copy link
Member

kingcody commented Aug 6, 2015

I'm going to close this PR as this functionality is covered in #1122 (along with others). Please feel free to discuss the implementation there.

@kingcody kingcody closed this Aug 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants